{template 'common/header'}
<script>
    function add(){
        var name = $("#name").val();
        if(name != ''){
            $.ajax({
                type : 'post',
                url : "{php echo $this->createWebUrl('goods',array('op' => 'add_unit'))}",
                data : {'name' : name},
                success : function(data){
                    if(data == 111){
                        alert("操作成功！");
                        location.reload();
                    }
                }
            });
        }
    }
</script>
<ul class="nav nav-tabs">
    <li ><a href="{php echo $this->createWebUrl('members', array('op'=>'index'))}">客户列表</a></li>
    <li><a href="{php echo $this->createWebUrl('members', array('op'=>'add'))}">新增客户</a></li>
    <li class="active"><a href="{php echo $this->createWebUrl('members', array('op'=>'type'))}">客户类型</a></li>
</ul>
<div class="main">
    <div class="row">
        <div class="col-xs-3">
            <input type="text" id="name" class="form-control" placeholder="单位名称"/>
        </div>
        <div class="col-xs-2">
            <button onclick="add();" class="btn btn-primary">添加</button>
        </div>
    </div>
    <br />
    <div>
        <table class="table">
            <tr>
                <th>类型</th>
                <th>操作</th>
            </tr>
            <tr>
                <td>快递</td>
                <td>
                    <button class="btn btn-danger">删除</button>
                </td>
            </tr>
            <tr>
                <td>个人</td>
                <td>
                    <button class="btn btn-danger">删除</button>
                </td>
            </tr>
            <tr>
                <td>商铺</td>
                <td>
                    <button class="btn btn-danger">删除</button>
                </td>
            </tr>
            {loop $unit $u}
            <tr>
                <td>{$u['name']}</td>
                <td>
                    <button class="btn btn-danger">删除</button>
                </td>
            </tr>
            {/loop}
        </table>
    </div>
</div>



{template 'common/footer'}